Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 3 - Window Manager Reference / Window Manager Functions
Retrieving Window Information /


FindWindow

CHANGED WITH THE APPEARANCE MANAGER

Maps the location of the cursor to a part of the screen or a region of a window when your application receives a mouse-down event.

pascal short FindWindow (
                     Point thePoint,
                     WindowPtr *theWindow);
thePoint
The point, in global coordinates, where the mouse-down event occurred. Your application retrieves this information from the where field of the event structure.
theWindow
A pointer to the window in which the mouse-down event occurred. FindWindow produces nil if the mouse-down event occurred outside a window.
function result
Returns a short integer that specifies where the cursor was when the user pressed the mouse button; see "FindWindow Result Code Constants".
DISCUSSION
You typically call the function FindWindow whenever you receive a mouse-down event. The FindWindow function helps you dispatch the event by reporting whether the cursor was in the menu bar or in a window when the mouse button was pressed. If the cursor was in a window, the function will produce both a pointer to the window and a constant that identifies the region of the window in which the event occurred. If Appearance is available, FindWindow may return the inCollapseBox constant as one of the possible window regions.

WHEN THE APPEARANCE MANAGER IS NOT AVAILABLE
The inCollapseBox constant will not be returned by FindWindow.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998